Click To Expand Menus

Serious Sites

Funny Sites

Updates

I've updated a few things in the script so here's a quick run-down of them.

If you look at the beginning of the .js file you'll see a few variables that you can configure. Hopefully that should make tweaking it a bit easier.

I've also worked in a couple of other features, the major one being the ability to have multiple menus running on the page with ease. All you have to do is pass their ID's to the initiate function in an array and the script will do the rest.

Another feature is the ability to specify different images for certain items in the menu through the use of custom HTML attributes. There are three attributes that the script looks for; cteopen, cteclosed and cteitem. cteopen and cteclosed are the icons for opening and closing branches of the menu. cteitem is only for <li>'s that don't have any <ul>'s in.

If you are curious how to use different icons then check out the source code, I've included an example of how to do it on the "World Wide Web Consortium" branch.

There are two things that I should make quite clear about the use of these attributes. Firstly, you need to use these attributes on the <li>'s, it won't work on anything else, and secondly, use of these attributes will invalidate your markup, however they don't cause any accessibility problems so it shouldn't be an issue.